<?php
class ModuleInit extends Zend_Controller_Plugin_Abstract
{
	public function dispatchloopStartup(Zend_Controller_Request_Abstract $request)
	{
		$module=$this->getRequest()->getModuleName();
		$moduleDir=APPLICATION_PATH.'/'.$module;
		
		$config=new Zend_Config_Ini($moduleDir.'/config/config.ini');
		Zend_Registry::set('config_'.$module,$config);
		
		#$layoutPath=$moduleDir.'/layouts/';
		#Zend_Layout::getMvcInstance()->setLayoutPath($layoutPath);
		#Zend_Layout::startMvc(array('layoutPath' => APPLICATION_PATH.'/default/layouts','layout' => 'main'));
		Zend_Registry::set('module',$module);
		#Zend_Layout::getMvcInstance()->footermodule='Default';
		
	}
}